﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Win8NearMe.Bean
{
    using Windows.UI.Xaml.Data;
    using Windows.UI.Xaml.Media;
    using Windows.UI.Xaml.Media.Imaging;

#if DISABLE_SAMPLE_DATA
	internal class Data { }
#else
    public class Person:Object
    {
        private double _id = 0;

        public double id
        {
            get
            {
                return this._id;
            }

            set
            {
                if (this._id != value)
                {
                    this._id = value;
                }
            }
        }

        private String _name;
        public string name
        {
            get
            {
                return this._name;
            }

            set
            {
                if (this._name != value)
                {
                    this._name = value;
                }
            }
        }

        private String _avatar;
        public string avatar
        {
            get
            {
                return this._avatar;
            }

            set
            {
                if (this._avatar != value)
                {
                    this._avatar = value;
                }
            }
        }

        private String _gender;
        public string gender
        {
            get
            {
                return this._gender;
            }

            set
            {
                if (this._gender != value)
                {
                    this._gender = value;
                }
            }
        }

        private String _status;
        public string status
        {
            get
            {
                return this._status;
            }

            set
            {
                if (this._status != value)
                {
                    this._status = value;
                }
            }
        }

        private ImageSource _Image = null;
        public ImageSource Image
        {
            get
            {
                return this._Image;
            }

            set
            {
                if (this._Image != value)
                {
                    this._Image = value;
                }
            }
        }

        private String _lon;
        public String lon
        {
            get
            {
                return this._lon;
            }

            set
            {
                if (this._lon != value)
                {
                    this._lon = value;
                }
            }
        }

        private String _lat;
        public String lat
        {
            get
            {
                return this._lat;
            }

            set
            {
                if (this._lat != value)
                {
                    this._lat = value;
                }
            }
        }

        private CDistance _distance;
        public CDistance distance
        {
            get
            {
                return this._distance;
            }

            set
            {
                if (this._distance != value)
                {
                    this._distance = value;
                }
            }
        }

        public Person(double id, String name, String status,String lat, String lon,CDistance distance)
        {
            this.id = id;
            this.name = name;
            this.status = status;
            this.lat = lat;
            this.lon = lon;
            this.distance = distance;
        }

        public Person()
        {
            // TODO: Complete member initialization
        }
        public void SetImage(Uri baseUri, String path)
        {
            Image = new BitmapImage(new Uri(baseUri, path));
        }

    }

    public class PersonCollection : IEnumerable<Object>
    {
        private System.Collections.ObjectModel.ObservableCollection<Person> itemCollection = new System.Collections.ObjectModel.ObservableCollection<Person>();

        public IEnumerator<Object> GetEnumerator()
        {
            return itemCollection.GetEnumerator();
        }

        System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
        {
            return GetEnumerator();
        }

        public void Add(Person item)
        {
            itemCollection.Add(item);
        }
    }

    public class MessageData
    {
        private Person _person;

        public Person person 
        {
            get
            {
                return this._person;
            }

            set
            {
                if (this._person != value)
                {
                    this._person = value;
                }
            }
        }

        public MessageData()
        {
            Person person = new Person();
            Uri _baseUri = new Uri("ms-appx:///");

            //person = new Person();
            //person.id = "1";
            //person.name = "ABCDEF1";
            //person.gender = "male";
            //person.avatar = "NULL";
            //person.status = "Code xuyen man dem 1";
            //person.SetImage(_baseUri, "Images/msg.png");
            //Collection.Add(person);

            //person = new Person();
            //person.id = "2";
            //person.name = "ABCDEF2";
            //person.gender = "male";
            //person.avatar = "NULL";
            //person.status = "Code xuyen man dem 2";
            //Collection.Add(person);

            //person = new Person();
            //person.id = "2";
            //person.name = "ABCDEF2";
            //person.gender = "male";
            //person.avatar = "NULL";
            //person.status = "Code xuyen man dem 2";
            //Collection.Add(person);
        }

        private List<CFriend> _Collection = new List<CFriend>();

        public List<CFriend> Collection
        {
            get
            {
                return this._Collection;
            }
        }
    }
#endif
}
